﻿# namespace = consort_play

# #################
# ##Consort's POV##
# #################

# scripted_effect clear_harem_interactions_flags_effect = {
# 	if = {
# 		limit = { 
# 			has_character_flag = is_visiting_harem_character_flag
# 		}
# 		remove_character_flag = is_visiting_harem_character_flag
# 	}
# 	if = {
# 		limit = { 
# 			has_character_flag = is_being_visited_harem_character_flag
# 		}
# 		remove_character_flag = is_being_visited_harem_character_flag
# 	}
# 	if = {
# 		limit = { 
# 			has_character_flag = flag_was_rejected_by_liege
# 		}
# 		remove_character_flag = flag_was_rejected_by_liege
# 	}
# 	if = {
# 		limit = { 
# 			has_character_flag = flag_was_rejected_by_authority
# 		}
# 		remove_character_flag = flag_was_rejected_by_authority
# 	}
# 	if = {
# 		limit = { 
# 			has_character_flag = flag_was_rejected_by_fellow_consort
# 		}
# 		remove_character_flag = flag_was_rejected_by_fellow_consort
# 	}
# 	if = {
# 		limit = { 
# 			has_character_flag = flag_was_rejected_by_subordinate
# 		}
# 		remove_character_flag = flag_was_rejected_by_subordinate
# 	}
# }

# scripted_effect consort_gp_promote_relative_effect = {
# 	if = {
# 		limit = {
# 			scope:consort_relative = {
# 				is_landed = yes
# 				primary_title = {
# 					de_jure_liege = {
# 						is_title_created = no
# 						any_in_de_jure_hierarchy = {
# 							filter = {
# 								tier = tier_county
# 							}
# 							holder ?= {
# 								OR = {
# 									this = scope:harem_liege
# 									is_vassal_or_below_of = scope:harem_liege
# 								}
# 							}
# 							percent >= 0.50
# 						}
# 					}
# 				}
# 			}
# 		}
# 		#Subtract some money
# 		remove_short_term_gold = create_duchy_title_value_harem_politics
# 	}

# 	create_title_and_vassal_change = {
# 		type = granted
# 		save_scope_as = change
# 		add_claim_on_loss = no
# 	}
# 	scope:worst_title = {
# 		change_title_holder = {
# 			holder = scope:consort_relative
# 			change = scope:change
# 		}
# 		if = {
# 			limit = {
# 				tier = tier_duchy
# 			}
# 			#If the holder has other associated titles, they're given as well
# 			if = {
# 				limit = {
# 					any_in_de_jure_hierarchy = {
# 						tier = tier_county
# 						exists = holder
# 						holder = scope:harem_liege
# 					}
# 				}
# 				every_in_de_jure_hierarchy = {
# 					limit = {
# 						tier = tier_county
# 						exists = holder
# 						holder = scope:harem_liege
# 					}
# 					change_title_holder = {
# 						holder = scope:consort_relative
# 						change = scope:change
# 					}
# 				}
# 				scope:consort_relative = {
# 					add_opinion = {
# 						target = scope:harem_liege
# 						modifier = received_title_county
# 					}
# 				}
# 			}
# 			#If the holder is root's vassal, the vassal is also transferred
# 			if = {
# 				limit = {
# 					any_in_de_jure_hierarchy = {
# 						tier = tier_county
# 						holder ?= {
# 							is_vassal_of = scope:harem_liege
# 							NOT = { this = scope:consort_relative }
# 							primary_title = {
# 								de_jure_liege = {
# 									this = scope:worst_title
# 								}
# 							}
# 						}
# 					}
# 				}
# 				every_in_de_jure_hierarchy = {
# 					limit = {
# 						tier = tier_county
# 						holder ?= {
# 							is_vassal_of = scope:harem_liege
# 							NOT = { this = scope:consort_relative }
# 							primary_title = {
# 								de_jure_liege = {
# 									this = scope:worst_title
# 								}
# 							}
# 						}
# 					}
# 					holder = {
# 						change_liege = {
# 							liege = scope:consort_relative
# 							change = scope:change
# 						}
# 					}
# 				}
# 				scope:consort_relative = {
# 					add_opinion = {
# 						target = scope:harem_liege
# 						modifier = granted_vassal
# 					}
# 				}
# 			}
# 		}
# 	}
# 	resolve_title_and_vassal_change = scope:change
# 	scope:consort_relative = {
# 		if = {
# 			limit = { scope:worst_title.tier = tier_barony }
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = received_title_barony
# 			}
# 			if = { #Your relative gives you influence
# 				limit = {
# 					government_allows = administrative
# 				}
# 				change_influence = miniscule_influence_gain
# 			}
# 		}
# 		else_if = {
# 			limit = { scope:worst_title.tier = tier_county }
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = received_title_county
# 			}
# 			if = { #Your relative gives you influence
# 				limit = {
# 					government_allows = administrative
# 				}
# 				change_influence = minor_influence_gain
# 			}
# 		}
# 		else_if = {
# 			limit = { scope:worst_title.tier = tier_duchy }
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = received_title_duchy
# 			}
# 			if = { #Your relative gives you influence
# 				limit = {
# 					government_allows = administrative
# 				}
# 				change_influence = medium_influence_gain
# 			}
# 		}
		
# 		if = {
# 			limit = {
# 				is_close_family_of = scope:consort
# 				NOT = {
# 					is_allied_to = scope:harem_liege
# 				}
# 			}
# 			create_alliance = {
# 				target = scope:harem_liege
# 				allied_through_owner = scope:harem_liege
# 				allied_through_target = scope:consort
# 			}
# 		}
# 		else_if = {
# 			limit = {
# 				NOT = {
# 					is_allied_to = scope:harem_liege
# 				}
# 			}
# 			add_truce_both_ways = {
# 				character = scope:harem_liege
# 				years = 4
# 				name = TRUCE_HAREM
# 			}
# 		}

# 		hidden_effect = {
# 			if = {
# 				limit = {
# 					exists = house
# 					any_close_family_member = {
# 						is_lowborn = yes
# 					}
# 				}
# 				every_close_family_member = {
# 					limit = {
# 						is_lowborn = yes
# 					}
# 					set_house = scope:consort_relative.house
# 				}
# 			}
# 		}
# 	}
# 	if = {
# 		limit = {
# 			can_add_hook = {
# 				target = scope:consort_relative
# 				type = indebted_hook
# 			}
# 		}
# 		add_hook = {
# 			target = scope:consort_relative
# 			type = indebted_hook
# 		}
# 	}
# }

# scripted_trigger can_be_promoted_trigger = {
# 	OR = {
# 		AND = { #Concubine to spouse
# 			is_concubine = yes
# 			scope:harem_liege = {
# 				allowed_more_spouses = yes
# 			}
# 		}
# 		AND = { #The GC
# 			scope:harem_liege = {
# 				can_appoint_char_to_court_position = {
# 					CHAR = scope:consort
# 					COURT_POS = grand_consort_court_position
# 				}
# 			}
# 		}
# 	}
# }

# consort_play.0001 = {
# 	type = character_event
# 	title = consort_play.0001.t
# 	desc = {
# 		desc = consort_play.0001.intro.desc
# 		first_valid = {
# 			triggered_desc = {
# 				trigger = {
# 					scope:harem_liege.primary_spouse ?= root
# 				}
# 				desc = consort_play.0001.ps.desc
# 			}
# 			triggered_desc = {
# 				desc = consort_play.0001.generic.desc
# 			}
# 		}
# 	}
# 	theme = intrigue
# 	override_background = { reference = corridor_night }
# 	left_portrait = {
# 		character = root
# 		animation = spymaster
# 	}
	
# 	trigger = {
# 		NOR = {
# 			exists = scope:is_being_divorced
# 			exists = scope:is_being_set_aside
# 		}
# 	}

# 	immediate = {
# 		#Add lifestyle_xp
# 		# if = {
# 		# 	limit = {
# 		# 		age > 16
# 		# 	}
# 		# 	save_scope_value_as = {
# 		# 		name = years_experience
# 		# 		value = age
# 		# 		subtract = 16
# 		# 		round = yes
# 		# 	}
# 		# 	if = {
# 		# 		limit = {
# 		# 			has_education_martial_trigger = yes
# 		# 		}
# 		# 		add_martial_lifestyle_xp = consort_lifestyle_xp
# 		# 	}
# 		# 	else_if = {
# 		# 		limit = {
# 		# 			has_education_diplomacy_trigger = yes
# 		# 		}
# 		# 		add_diplomacy_lifestyle_xp = consort_lifestyle_xp
# 		# 	}
# 		# 	else_if = {
# 		# 		limit = {
# 		# 			has_education_learning_trigger = yes
# 		# 		}
# 		# 		add_learning_lifestyle_xp = consort_lifestyle_xp
# 		# 	}
# 		# 	else_if = {
# 		# 		limit = {
# 		# 			has_education_stewardship_trigger = yes
# 		# 		}
# 		# 		add_stewardship_lifestyle_xp = consort_lifestyle_xp
# 		# 	}
# 		# 	else_if = {
# 		# 		limit = {
# 		# 			has_education_intrigue_trigger = yes
# 		# 		}
# 		# 		add_intrigue_lifestyle_xp = consort_lifestyle_xp
# 		# 	}
# 		# }
# 	}
	
# 	option = {
# 		name = consort_play.0001.a #Check
# 		# trigger_event = {
# 		# 	id = consort_play.0002
# 		# 	days = { 7 14 }
# 		# }
# 		ai_chance = {
# 			base = 1
# 		}
# 	}
# }

# consort_play.0002 = {
# 	type = character_event
# 	title = consort_play.0002.t
# 	desc = {
# 		desc = consort_play.0002.intro.desc
# 		first_valid = {
# 			## Attendant
# 			triggered_desc = {
# 				trigger = {
# 					exists = scope:attendant
# 				}
# 				desc = consort_play.0002.attendant.desc
# 			}
# 			## Servant
# 			triggered_desc = {
# 				desc = consort_play.0002.servant.desc
# 			}
# 		}
# 		desc = consort_play.0002.end.desc
# 	}
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	left_portrait = {
# 		character = scope:consort
# 		animation = disapproval
# 	}
# 	right_portrait = {
# 		trigger = {
# 			exists = scope:attendant
# 		}
# 		character = scope:attendant
# 		animation = personality_bold
# 	}
# 	lower_center_portrait = {
# 		character = scope:harem_liege
# 	}
	
# 	trigger = {
# 		NOR = {
# 			exists = scope:is_being_divorced
# 			exists = scope:is_being_set_aside
# 		}
# 		is_physically_able_adult = yes
# 		exists = scope:harem_liege
# 	}

# 	immediate = {
# 		scope:harem_liege = {
# 			if = {
# 				limit = {
# 					NOT = {
# 						exists = scope:attendant
# 					}
# 					OR = {	
# 						employs_court_position = lady_in_waiting_court_position
# 						has_court_position = chief_eunuch_court_position
# 					}
# 				}
# 				random_courtier = {
# 					limit = {
# 						OR = {
# 							has_court_position = chief_eunuch_court_position
# 							has_court_position = lady_in_waiting_court_position
# 						}
# 					}
# 					save_scope_as = attendant
# 				}
# 			}
# 		}
# 	}
	
# 	#How dare you? Look for a vanilla option
# 	option = {
# 		name = consort_play.0002.a #Check

# 		clear_harem_interactions_flags_effect = yes

# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#Spend some favor
# 	#option = {
# 	#	name = consort_play.0002.b # Check
# 	#
# 	#	clear_harem_interactions_flags_effect = yes
# 	#
# 	#	ai_chance = {
# 	#		base = 1
# 	#	}
# 	#}

# 	#Pay them
# 	option = {
# 		name = consort_play.0002.c # Check
# 		trigger = {
# 			gold >= 5
# 		}
# 		show_as_unavailable = {
# 			gold < 5 
# 		}
	
# 		set_local_variable = {
# 			name = bribed_servant
# 			value = yes
# 		}

# 		if = {
# 			limit = {
# 				exists = scope:attendant
# 			}
# 			pay_short_term_gold = {
# 				target = scope:attendant
# 				gold = 5
# 			}
# 		}
# 		else = {
# 			remove_short_term_gold = 5
# 		}
		
# 		stress_impact = {
# 			greedy = minor_stress_impact_gain
# 		}
# 		show_as_tooltip = {
# 			stress_impact = {
# 				shy = minor_stress_impact_gain
# 			}
# 		}
	
# 		scope:harem_liege = {
# 			trigger_event = {
# 				id = consort_play.1000
# 				days = 1
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#Yell
# 	#option = {
# 	#	name = consort_play.0002.a # Check
# 	#
# 	#	clear_harem_interactions_flags_effect = yes
# 	#
# 	#	ai_chance = {
# 	#		base = 1
# 	#	}
# 	#}
# }

# consort_play.0003 = {
# 	type = character_event
# 	title = consort_play.0002.t
# 	desc = { 
# 		first_valid = {
# 			## Attendant
# 			triggered_desc = {
# 				trigger = {
# 					exists = scope:attendant
# 				}
# 				desc = consort_play.0002.rejected_visit.attendant.desc
# 			}
# 			## Servant
# 			triggered_desc = {
# 				desc = consort_play.0002.rejected_visit.servant.desc
# 			}
# 		}
# 		desc = consort_play.0002.rejected_visit.end.desc
# 	}
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	left_portrait = {
# 		character = scope:consort
# 		animation = disapproval
# 	}
# 	right_portrait = {
# 		trigger = {
# 			exists = scope:attendant
# 		}
# 		character = scope:attendant
# 		animation = personality_bold
# 	}
# 	lower_center_portrait = {
# 		character = scope:harem_liege
# 	}
	
# 	trigger = {
# 		NOR = {
# 			exists = scope:is_being_divorced
# 			exists = scope:is_being_set_aside
# 		}
# 		is_physically_able_adult = yes
# 		exists = scope:harem_liege
# 		exists = local_var:rejected_visit
# 	}

# 	immediate = {
# 		scope:harem_liege = {
# 			if = {
# 				limit = {
# 					NOT = {
# 						exists = scope:attendant
# 					}
# 					OR = {	
# 						employs_court_position = lady_in_waiting_court_position
# 						has_court_position = chief_eunuch_court_position
# 					}
# 				}
# 				random_courtier = {
# 					limit = {
# 						OR = {
# 							has_court_position = chief_eunuch_court_position
# 							has_court_position = lady_in_waiting_court_position
# 						}
# 					}
# 					save_scope_as = attendant
# 				}
# 			}
# 		}
# 	}
	
# 	#How dare you? Look for a vanilla option
# 	option = {
# 		name = consort_play.0002.rejected.a

# 		add_opinion = {
# 			target = scope:harem_liege
# 			modifier = disappointed_opinion
# 			opinion = -10
# 		}
# 		#Loses favor

# 		clear_harem_interactions_flags_effect = yes

# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#Spend some favor
# 	#option = {
# 	#	name = consort_play.0002.b # Check
# 	#
# 	#	clear_harem_interactions_flags_effect = yes
# 	#
# 	#	ai_chance = {
# 	#		base = 1
# 	#	}
# 	#}

# 	#Yell
# 	#option = {
# 	#	name = consort_play.0002.a # Check
# 	#
# 	#	clear_harem_interactions_flags_effect = yes
# 	#
# 	#	ai_chance = {
# 	#		base = 1
# 	#	}
# 	#}
# }

# ##Visiting liege##
# consort_play.0004 = {
# 	type = character_event
# 	title = consort_play.0004.t
# 	desc = consort_play.0004.desc
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	left_portrait = {
# 		character = scope:consort
# 		animation = personality_content
# 	}
# 	right_portrait = {
# 		character = scope:harem_liege
# 		animation = personality_honorable
# 	}
	
# 	trigger = {
# 		NOR = {
# 			exists = scope:is_being_divorced
# 			exists = scope:is_being_set_aside
# 		}
# 		is_physically_able_adult = yes
# 		exists = scope:harem_liege
# 	}

# 	immediate = {
# 		stress_impact = {
# 			shy = minor_stress_impact_gain
# 		}
# 	}
	
# 	#Pleasant conversation
# 	option = {
# 		name = consort_play.0004.a

# 		duel = {
# 			skill = diplomacy
# 			value = average_skill_rating
# 			50 = { # Success
# 				compare_modifier = {
# 					value = scope:duel_value
# 					multiplier = 0.5
# 				}
# 				opinion_modifier = {
# 					who = scope:harem_liege
# 					opinion_target = scope:consort
# 					multiplier = 0.1
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = gregarious }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:harem_liege = { has_trait = gregarious }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = lifestyle_reveler }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:harem_liege = { has_trait = lifestyle_reveler }
# 					add = 5
# 				}
# 				modifier = { #Diplomatic consorts
# 					scope:consort = { 
# 						has_character_modifier = diplomatic_consort_modifier
# 					}
# 					add = 5
# 				}
# 				set_local_variable = {
# 					name = pleasant_conversation_success
# 					value = yes
# 				}
# 				desc = consort_play.0004.a.tt.success
# 			}
# 			0 = { # They think you suck.
# 				compare_modifier = {
# 					value = scope:duel_value
# 					multiplier = -0.30
# 				}
# 				opinion_modifier = {
# 					who = scope:harem_liege
# 					opinion_target = scope:consort
# 					multiplier = -0.1
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = shy }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:harem_liege = { has_trait = shy }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = reclusive }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:harem_liege = { has_trait = reclusive }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = irritable }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:harem_liege = { has_trait = irritable }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = stuttering }
# 					add = 5
# 				}
# 				modifier = {
# 					scope:consort = { has_trait = lisping }
# 					add = 5
# 				}
# 				set_local_variable = {
# 					name = pleasant_conversation_failure
# 					value = yes
# 				}
# 				desc = consort_play.0004.a.tt.failure
# 			}
# 		}
# 		scope:harem_liege = {
# 			trigger_event = {
# 				id = consort_play.1001
# 				days = 1
# 			}	
# 		}

# 		ai_chance = {
# 			base = 1
# 		}
# 	}
# }

# ##Successful conversation##
# scripted_trigger valid_relative_promotion_trigger = {
# 	OR = {
# 		any_liege_or_above = {
# 			this = scope:harem_liege
# 		}
# 		AND = {
# 			exists = scope:harem_liege.top_liege
# 			top_liege ?= scope:harem_liege.top_liege
# 		}
# 	}
# 	is_available_healthy_adult = yes
# 	is_hostage = no

# 	NOR = {
# 		has_trait = ill
# 		has_trait = wounded
# 		has_character_modifier = recently_tortured
# 		any_consort = {
# 			this = scope:harem_liege
# 		}
# 		is_child_of = scope:harem_liege
# 		any_heir_title = {
# 			place_in_line_of_succession = {
# 				target = prev
# 				value <= 2
# 			}
# 		}
# 		has_hook = scope:harem_liege
# 	}
# 	trigger_if = {
# 		limit = { is_female = yes }
# 		scope:harem_liege = { faith_dominant_gender_female_or_equal = yes }
# 	}
# 	trigger_else = { faith_dominant_gender_male_or_equal = yes }

# 	#Landed
# 	trigger_if = {
# 		limit = {
# 			is_landed = yes
# 		}
# 		is_vassal_of = scope:harem_liege
# 		is_at_war = no
# 		OR = {	
# 			AND = { #Promote count to duke
# 				highest_held_title_tier = tier_county
# 				any_held_title = { #Not many titles
# 					tier = tier_county
# 					count <= 3
# 				}
# 				primary_title = {
# 					de_jure_liege = {
# 						OR = {
# 							holder ?= {
# 								this = scope:harem_liege
# 								any_held_title = {
# 									tier = tier_duchy
# 									is_head_of_faith = no
# 									is_noble_family_title = no
# 									count >= 2
# 								}
# 							}
# 							AND = {
# 								is_title_created = no
# 								any_in_de_jure_hierarchy = {
# 									filter = {
# 										tier = tier_county
# 									}
# 									holder ?= {
# 										OR = {
# 											this = scope:harem_liege
# 											is_vassal_of = scope:harem_liege
# 										}
# 									}
# 									percent >= 0.50
# 								}
# 								scope:harem_liege = {
# 									gold >= create_duchy_title_value_harem_politics
# 								}
# 							}
# 						}
# 						NOT = {
# 							any_de_jure_county = {
# 								this = scope:harem_liege.capital_county
# 							}
# 						}
# 					}
# 				}	
# 				scope:harem_liege = {
# 					highest_held_title_tier >= tier_kingdom
# 				}
# 			}
# 			AND = {	#Promote baron to count
# 				highest_held_title_tier = tier_barony
# 				primary_title = {
# 					de_jure_liege = {
# 						NOT = {
# 							this = scope:harem_liege.capital_county
# 						}
# 					}
# 				}	
# 				scope:harem_liege = {
# 					any_held_title = {
# 						tier = tier_county
# 						count >= 4
# 					}
# 					highest_held_title_tier >= tier_duchy
# 				}
# 			}
# 		}
# 		NOR = {
# 			government_has_flag = government_is_republic
# 			government_has_flag = government_is_theocracy
# 		}
# 	}
# 	trigger_else_if = { #Unlanded noble
# 		limit = {
# 			is_lowborn = no
# 			any_held_title = { count = 0 }
# 		}
# 		NOR = {
# 			any_consort = {
# 				is_ruler = yes
# 			}
# 			has_trait = devoted
# 			has_trait = order_member
# 			has_council_position = councillor_court_chaplain
# 		}
# 		scope:harem_liege = {
# 			OR = {
# 				any_held_title = {
# 					tier = tier_barony
# 					is_capital_barony = no
# 					is_leased_out = no
# 					# title_province ?= {
# 					# 	NOR = {
# 					# 		has_holding_type = city_holding 
# 					# 		has_holding_type = church_holding
# 					# 	}
# 					# }
# 					NOT = { 
# 						THIS = scope:harem_liege.capital_barony 
# 					}
# 				}
# 				any_held_title = {
# 					count >= 4
# 					tier = tier_county
# 				}
# 				# AND = { #Promote to Noble Family
# 				# 	government_allows = administrative
# 				# 	highest_held_title_tier >= tier_kingdom
# 				# 	gold >= 400
# 				# }
# 			}
# 		}
# 	}
# 	trigger_else = { #Lowborn
# 		is_lowborn = yes
# 		any_held_title = { count = 0 }
# 		NOT = {
# 			any_consort = {
# 				is_ruler = yes
# 			}
# 		}
# 		trigger_if = {
# 			limit = {
# 				OR = {	
# 					is_councillor = yes
# 					has_any_court_position = yes
# 				}
# 			}
# 			OR = {	
# 				is_courtier_of = scope:harem_liege
# 				top_liege ?= scope:harem_liege
# 			}
# 		}
# 		scope:harem_liege = {
# 			gold >= 20
# 			highest_held_title_tier >= tier_duchy
# 		}
# 	}

# 	trigger_if = {
# 		limit = {
# 			exists = dynasty
# 			exists = scope:harem_liege.dynasty
# 		}
# 		NOT = {
# 			dynasty = scope:harem_liege.dynasty
# 		}
# 	}

# 	scope:harem_liege = {
# 		gold > 0
# 	}
# }

# scripted_trigger is_valid_for_target_consort = {
# 	is_courtier_of = scope:harem_liege
# 	is_physically_able_adult = yes

# 	has_variable = favor

# 	NOR = {		
# 		has_trait = lunatic_1
# 		has_trait = lunatic_genetic
# 		has_trait = possessed_1
# 		has_trait = possessed_genetic
		
# 		has_relation_nemesis = scope:consort
# 		this = scope:consort
# 	}

# 	is_valid_for_favor_system_trigger = { HAREM_LIEGE = scope:harem_liege }
	
# 	OR = {
# 		AND = {
# 			is_travelling = yes
# 			current_travel_plan ={
# 				travel_plan_owner = root
# 			}
# 		}
# 		AND = {
# 			is_travelling = no
# 			root = {
# 				is_travelling = no
# 			}
# 		}
# 	}
# }

# consort_play.0005 = {
# 	type = character_event
# 	title = consort_play.1001.t.pleasant_conversation_success
# 	desc = {
# 		desc = consort_play.0005.desc
# 	}
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	left_portrait = {
# 		character = scope:consort
# 		animation = personality_content
# 	}
# 	right_portrait = {
# 		character = scope:harem_liege
# 		animation = personality_honorable
# 	}

# 	lower_left_portrait = {
# 		trigger = {
# 			exists = scope:good_consort
# 		}
# 		character = scope:good_consort
# 	}

# 	lower_center_portrait = {
# 		trigger = {
# 			exists = scope:consort_relative
# 		}
# 		character = scope:consort_relative
# 	}
	
# 	trigger = {
# 		NOR = {
# 			exists = scope:is_being_divorced
# 			exists = scope:is_being_set_aside
# 		}
# 		is_physically_able_adult = yes
# 		exists = scope:harem_liege
# 	}

# 	immediate = {
# 		if = {
# 			limit = {
# 				any_close_family_member = {
# 					valid_relative_promotion_trigger = yes
# 				}
# 				scope:harem_liege = {
# 					gold > 0
# 					NOR = {
# 						government_has_flag = government_is_republic
# 						government_has_flag = government_is_theocracy
# 					}
# 				}
# 			}
# 			every_close_family_member = {
# 				limit = {
# 					valid_relative_promotion_trigger = yes
# 				}
# 				add_to_list = consort_relatives_list
# 			}
# 			random_in_list = {
# 				list = consort_relatives_list
# 				weight = {
# 					base = 10
# 					modifier = { #Parents event more
# 						any_child = {
# 							this = scope:consort
# 						}
# 						add = 60
# 					}
# 					modifier = { #Same dynasty
# 						exists = dynasty
# 						exists = scope:consort.dynasty
# 						dynasty = scope:consort.dynasty
# 						add = 20
# 					}
# 					modifier = { #Same house
# 						exists = house
# 						exists = scope:consort.house
# 						house = scope:consort.house
# 						add = 15
# 					}
# 					modifier = { #House Head
# 						exists = scope:consort.house.house_head
# 						this = scope:consort.house.house_head
# 						add = 15
# 					}
# 					modifier = { #Landed
# 						is_landed = yes
# 						add = 15
# 					}
# 				}
# 				save_scope_as = consort_relative
# 			}
# 		}

# 		if = {
# 			limit = {
# 				scope:consort = {
# 					has_variable = favor
# 				}
# 				scope:harem_liege = {
# 					any_consort = {
# 						is_valid_for_target_consort = yes
# 					}
# 					any_consort = {
# 						is_valid_for_favor_system_trigger = { HAREM_LIEGE = scope:harem_liege }
# 						count >= 3
# 					}
# 				}
# 			}
# 			scope:harem_liege = {
# 				every_consort = {
# 					limit = {
# 						is_valid_for_target_consort = yes
# 					}
# 					add_to_list = good_consort_list
# 				}
# 			}
# 			random_in_list = {
# 				list = good_consort_list
# 				weight = {
# 					base = 10
# 					modifier = { #Hook
# 						has_hook = scope:consort
# 						add = 25
# 					}
# 					modifier = { #Friends
# 						OR = {	
# 							has_relation_potential_friend = scope:consort
# 							has_relation_potential_lover = scope:consort
# 						}
# 						add = 5
# 					}
# 					modifier = { #Friends
# 						OR = {	
# 							has_relation_friend = scope:consort
# 							has_relation_lover = scope:consort
# 						}
# 						add = 10
# 					}
# 					modifier = { #Friends
# 						OR = {	
# 							has_relation_best_friend = scope:consort
# 							has_relation_soulmate = scope:consort
# 						}
# 						add = 20
# 					}

# 					modifier = { #Rank
# 						exists = scope:harem_liege.primary_spouse
# 						this = scope:harem_liege.primary_spouse
# 						add = 15
# 					}
# 					modifier = { #Rank
# 						has_court_position = grand_consort_court_position
# 						add = 10
# 					}
# 					modifier = { #Rank
# 						is_spouse_of = scope:harem_liege
# 						NOR = {
# 							AND = {
# 								exists = scope:harem_liege.primary_spouse
# 								this = scope:harem_liege.primary_spouse
# 							}
# 							has_court_position = grand_consort_court_position
# 						}
# 						add = 5
# 					}

# 					modifier = { #Favor
# 						has_variable = favor
# 						var:favor <= forgotten_consort_upper_limit
# 						add = 15
# 					}
# 					modifier = { #Favor
# 						has_variable = favor
# 						var:favor <= unfavored_consort_upper_limit
# 						add = 10
# 					}

# 					#Opinion
# 					opinion_modifier = {
# 						who = scope:consort
# 						opinion_target = prev
# 						min = -30
# 						max = 30
# 						multiplier = 0.3
# 					}
# 				}
# 				save_scope_as = good_consort
# 			}
# 		}
# 	}
	
# 	#Continue with the conversation
# 	option = {
# 		name = consort_play.0005.a

# 		scope:harem_liege = {
# 			trigger_event = {
# 				id = consort_play.1002
# 				days = { 2 5 }
# 			}
# 		}

# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#Request a promotion
# 	option = {
# 		name = consort_play.0005.b
# 		custom_tooltip = consort_play.0005.b.tt
# 		trigger = {
# 			scope:consort = {
# 				can_be_promoted_trigger = yes
# 			}
# 			scope:harem_liege = {
# 				gold > 0
# 			}
# 		}

# 		set_local_variable = {
# 			name = requested_promotion
# 			value = yes
# 		}
# 		set_local_variable = {
# 			name = requested_harem_promotion
# 			value = yes
# 		}
# 		scope:harem_liege = {
# 			trigger_event = {
# 				id = consort_play.1002
# 				days = { 2 5 }
# 			}
# 		}

# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#Request a promotion for relative
# 	option = {
# 		name = consort_play.0005.c
# 		custom_tooltip = consort_play.0005.c.tt
# 		trigger = {
# 			exists = scope:consort_relative
# 			scope:harem_liege = {
# 				gold > 0
# 			}
# 		}

# 		set_local_variable = {
# 			name = requested_promotion
# 			value = yes
# 		}
# 		set_local_variable = {
# 			name = requested_relative_promotion
# 			value = yes
# 		}
# 		scope:consort_relative = {
# 			save_scope_as = visit_target
# 		}
# 		scope:harem_liege = {
# 			trigger_event = {
# 				id = consort_play.1002
# 				days = 1
# 			}
# 		}

# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#Speak highly of Consort
# 	option = {
# 		name = consort_play.0005.d
# 		trigger = {
# 			exists = scope:good_consort
# 		}
# 		show_as_unavailable = {
# 			exists = scope:good_consort
# 			has_variable = favor
# 			NOT = {
# 				var:favor < 24
# 			}
# 			custom_tooltip = { text = not_enough_favor } 
# 		}

# 		custom_tooltip = small_favor_cost
# 		if = {
# 			limit = {
# 				has_variable = favor
# 			}
# 			change_variable = {
# 				name = favor
# 				subtract = {
# 					value = favor_minor_value_gain
# 					multiply = 3
# 				}
# 			}
# 		}
# 		custom_tooltip = consort_play.0005.d.tt
		
# 		set_local_variable = {
# 			name = praised_fellow_consort
# 			value = yes
# 		}
# 		scope:good_consort = {
# 			save_scope_as = visit_target
# 		}
# 		scope:harem_liege = {
# 			trigger_event = {
# 				id = consort_play.1002
# 				days = 1
# 			}
# 		}

# 		ai_chance = {
# 			base = 50
# 		}
# 	}
# }
# ##################
# ##Visiting Liege##
# ##################

# ##A servant notifies you a consort wants to see you##
# consort_play.1000 = {
# 	type = character_event
# 	title = consort_play.1000.t
# 	desc = {	
# 		desc = consort_play.1000.intro.desc
# 		first_valid = {
# 			## Attendant
# 			triggered_desc = {
# 				trigger = {
# 					exists = scope:attendant
# 				}
# 				desc = {
# 					first_valid = {
# 						## Lady-in-waiting
# 						triggered_desc = {
# 							trigger = {
# 								scope:attendant = {
# 									has_court_position = lady_in_waiting_court_position
# 								}
# 							}
# 							desc = consort_play.1000.lady_in_waiting.desc
# 						}
# 						## Chief Eunuch
# 						triggered_desc = {
# 							trigger = {
# 								scope:attendant = {
# 									has_court_position = chief_eunuch_court_position
# 								}
# 							}
# 							desc = consort_play.1000.chief_eunuch.desc
# 						}
# 					}
# 					desc = consort_play.1000.attendant.desc
# 				}
# 			}
# 			## Servant
# 			desc = consort_play.1000.servant.desc
# 		}
# 		desc = consort_play.1000.end_1.desc
# 		first_valid = {
# 			## Attendant
# 			triggered_desc = {
# 				trigger = {
# 					exists = scope:attendant
# 				}
# 				desc = consort_play.1000.end_attendant.desc
# 			}
# 			## Servant
# 			desc = consort_play.1000.end_servant.desc
# 		}
# 		desc = consort_play.1000.end_2.desc
# 	}
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	right_portrait = {
# 		character = scope:harem_liege
# 		animation = personality_rational
# 	}
# 	left_portrait = {
# 		trigger = {
# 			exists = scope:attendant
# 		}
# 		character = scope:attendant
# 		animation = personality_content
# 	}
# 	lower_center_portrait = {
# 		character = scope:consort
# 	}
	
# 	trigger = {
# 		exists = scope:consort
# 		scope:harem_liege ?= {
# 			this = root
# 		}
# 		is_physically_able_adult = yes
# 		highest_held_title_tier >= tier_county
# 		is_landed_or_landless_administrative = yes
# 		any_consort = {
# 			is_available_allow_travelling = yes
# 			is_courtier_of = scope:harem_liege
# 			count >= 3
# 		}
# 	}

# 	immediate = {
# 		if = {
# 			limit = {
# 				OR = {	
# 					employs_court_position = lady_in_waiting_court_position
# 					has_court_position = chief_eunuch_court_position
# 				}
# 			}
# 			random_courtier = {
# 				limit = {
# 					OR = {
# 						has_court_position = chief_eunuch_court_position
# 						has_court_position = lady_in_waiting_court_position
# 					}
# 				}
# 				save_scope_as = attendant
# 			}
# 		}
# 	}
	
# 	#See them
# 	option = {
# 		name = consort_play.1000.a
# 		custom_tooltip = consort_play.1000.a.tt
# 		scope:consort = {
# 			add_character_flag = {
# 				flag = liege_accepted_visit_flag
# 				days = 6
# 			}
# 			trigger_event = {
# 				id = consort_play.0004
# 				days = { 2 5 }
# 			}	
# 		}

# 		stress_impact = {
# 			shy = minor_stress_impact_gain
# 		}
		
# 		ai_chance = {
# 			base = 50
# 			modifier = { #Rank
# 				add = 15
# 				scope:harem_liege.primary_spouse ?= scope:consort
# 			}
# 			modifier = { #Rank
# 				add = 10
# 				scope:consort = {
# 					has_court_position = grand_consort_court_position
# 				}
# 			}
# 			modifier = { #Rank
# 				add = 5
# 				scope:consort = {
# 					is_spouse_of = scope:harem_liege
# 					NOR = {
# 						this = scope:harem_liege.primary_spouse
# 						has_court_position = grand_consort_court_position
# 					}
# 				}
# 			}
# 		}
# 	}

# 	#Reject them
# 	option = {
# 		name = consort_play.1000.b
# 		trigger = {
# 			NOT = {
# 				exists = local_var:bribed_servant
# 			}
# 		}
# 		clear_harem_interactions_flags_effect = yes

# 		#Add a modifier to improve certain skills
		
# 		scope:consort = {
# 			#add_character_flag = {
# 			#	flag = flag_was_rejected_by_liege
# 			#	days = 6
# 			#}
# 			show_as_tooltip = {
# 				add_opinion = {
# 					target = scope:harem_liege
# 					modifier = disappointed_opinion
# 					opinion = -10
# 				}
# 				#Loses favor
# 			}
# 			set_local_variable = {
# 				name = rejected_visit
# 				value = yes
# 			}
# 			trigger_event = {
# 				id = consort_play.0003
# 				days = 1
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 		}
# 	}
# }

# ##Pleasant conversation with consort##
# consort_play.1001 = {
# 	type = character_event
# 	title = {
# 		first_valid = {
# 			triggered_desc = { #Success
# 				trigger = {
# 					exists = local_var:pleasant_conversation_success
# 				}
# 				desc = consort_play.1001.t.pleasant_conversation_success
# 			}
# 			triggered_desc = { #Failure
# 				desc = consort_play.1001.t.pleasant_conversation_failure
# 			}
# 		}
# 	}
# 	desc = {
# 		first_valid = {
# 			triggered_desc = { #Success
# 				trigger = {
# 					exists = local_var:pleasant_conversation_success
# 				}
# 				desc = consort_play.1001.desc.pleasant_conversation_success
# 			}
# 			triggered_desc = { #Failure
# 				desc = consort_play.1001.desc.pleasant_conversation_failure
# 			}
# 		}
# 	}
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	right_portrait = {
# 		character = scope:consort
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_success
# 			}
#   			animation = happiness
#   		}
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_failure
# 			}
# 			animation = shame
#   		}
# 	}
# 	left_portrait = {
# 		character = scope:harem_liege
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_success
# 			}
#   			animation = admiration	
#   		}
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_failure
# 			}
# 			animation = boredom
#   		}
# 	}
	
# 	trigger = {
# 		exists = scope:consort
# 		scope:harem_liege ?= {
# 			this = root
# 		}
# 		is_physically_able_adult = yes
# 		highest_held_title_tier >= tier_county
# 		is_landed_or_landless_administrative = yes
# 		any_consort = {
# 			is_available_allow_travelling = yes
# 			is_courtier_of = scope:harem_liege
# 			count >= 3
# 		}
# 		OR = {
# 			exists = local_var:pleasant_conversation_success
# 			exists = local_var:pleasant_conversation_failure
# 		}
# 	}

# 	immediate = {
# 		if = {
# 			limit = {
# 				exists = local_var:pleasant_conversation_success
# 			}
# 			add_opinion = {
# 				modifier = pleased_opinion
# 				opinion = 5
# 				target = scope:consort
# 			}
# 			scope:consort = {
# 				add_opinion = {
# 					modifier = pleased_opinion
# 					opinion = 5
# 					target = scope:harem_liege
# 				}
# 			}
# 			if = {
# 				limit = {
# 					NOT = {
# 						has_trait = shy
# 					}
# 				}
# 				stress_impact = {   
# 					base = minor_stress_impact_loss
# 					gregarious = minor_stress_impact_loss
# 				}
# 			}
# 		}
# 		else = {
# 			add_opinion = {
# 				target = scope:consort
# 				modifier = disappointed_opinion
# 				opinion = -10
# 			}
# 		}
# 	}
	
# 	#Great
# 	option = {
# 		name = consort_play.1001.a
# 		trigger = {
# 			NOT = {
# 				exists = local_var:pleasant_conversation_failure
# 			}
# 		}
# 		scope:consort = {
# 			trigger_event = {
# 				id = consort_play.0005
# 				days = { 2 5 }
# 			}	
# 		}
		
# 		ai_chance = {
# 			base = 30
# 		}
# 	}

# 	#Reject them
# 	option = {
# 		name = {
# 			text = {
# 				first_valid = {
# 					triggered_desc = {
# 						trigger = { exists = local_var:pleasant_conversation_success }
# 						desc = consort_play.1001.b.success
# 					}
# 					desc = consort_play.1001.b.failure
# 				}
# 			}
# 		}

# 		clear_harem_interactions_flags_effect = yes
# 		scope:consort = {
# 			show_as_tooltip = {
# 				#Loses favor
# 				if = {
# 					limit = {
# 						exists = local_var:pleasant_conversation_success
# 					}
# 					add_opinion = {
# 						target = scope:harem_liege
# 						modifier = disappointed_opinion
# 						opinion = -10
# 					}
# 				}
# 				stress_impact = {   
# 					gregarious = minor_stress_impact_gain
# 				}
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 		}
# 	}
# }

# ##Pleasant conversation - result##
# consort_play.1002 = {
# 	type = character_event
# 	title = {
# 		first_valid = {
# 			triggered_desc = { #Words of Praise
# 				trigger = {
# 					exists = local_var:praised_fellow_consort
# 				}
# 				desc = consort_play.1002.t.praise
# 			}
# 			triggered_desc = { #A bold request
# 				trigger = {
# 					OR = {	
# 						exists = local_var:requested_harem_promotion
# 						exists = scope:worst_title
# 						AND = {
# 							scope:consort_relative ?= {
# 								is_lowborn = yes
# 							}
# 							exists = local_var:requested_relative_promotion
# 						}
# 					}
# 				}
# 				desc = consort_play.1002.t.request
# 			}
# 			triggered_desc = { #Pleasant conversation
# 				desc = consort_play.1001.t.pleasant_conversation_success
# 			}
# 		}
# 	}
# 	desc = {
# 		first_valid = {
# 			triggered_desc = { #Words of Praise
# 				trigger = {
# 					exists = local_var:praised_fellow_consort
# 				}
# 				desc = consort_play.1002.desc.praise
# 			}
# 			triggered_desc = { #A bold request
# 				trigger = {
# 					exists = scope:worst_title
# 				}
# 				desc = consort_play.1002.desc.land_relative_promotion
# 			}
# 			triggered_desc = { #A bold request
# 				trigger = {
# 					scope:consort_relative ?= {
# 						is_lowborn = yes
# 					}
# 					exists = local_var:requested_relative_promotion
# 				}
# 				desc = consort_play.1002.desc.lowborn_relative_promotion
# 			}
# 			triggered_desc = { #A bold request
# 				trigger = {
# 					exists = local_var:requested_harem_promotion
# 				}
# 				desc = consort_play.1002.desc.harem_promotion
# 			}
# 			triggered_desc = {
# 				desc = consort_play.1002.desc.generic
# 			}
# 		}
# 	}
# 	theme = family
# 	override_background = {
# 		reference = study
# 	}
	
# 	right_portrait = {
# 		character = scope:consort
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_success
# 			}
#   			animation = happiness
#   		}
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_failure
# 			}
# 			animation = shame
#   		}
# 	}
# 	left_portrait = {
# 		character = scope:harem_liege
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_success
# 			}
#   			animation = admiration	
#   		}
# 		triggered_animation = {
# 			trigger = {
# 				exists = local_var:pleasant_conversation_failure
# 			}
# 			animation = boredom
#   		}
# 	}

# 	lower_center_portrait = { 	
# 		trigger = {
# 			exists = scope:visit_target
# 			OR = {	
# 				exists = scope:worst_title
# 				exists = local_var:praised_fellow_consort
# 				AND = {
# 					scope:consort_relative ?= {
# 						is_lowborn = yes
# 					}
# 					exists = local_var:requested_relative_promotion
# 				}
# 			}
# 		}
# 		character = scope:visit_target
# 	}
	
# 	trigger = {
# 		exists = scope:consort
# 		scope:harem_liege ?= {
# 			this = root
# 		}
# 		is_physically_able_adult = yes
# 		highest_held_title_tier >= tier_county
# 		is_landed_or_landless_administrative = yes
# 	}

# 	immediate = {
# 		if = {
# 			limit = {
# 				exists = local_var:requested_relative_promotion
# 				scope:consort_relative = {
# 					valid_relative_promotion_trigger = yes
# 					is_lowborn = no
# 				}
# 			}
# 			if = {
# 				limit = {
# 					scope:consort_relative = {
# 						any_held_title = { count = 0 }
# 					}
# 				}
# 				if = { # Find a valid barony to give away
# 					limit = {
# 						any_held_title = {
# 							tier = tier_barony
# 							is_capital_barony = no
# 							is_leased_out = no
# 							# title_province ?= {
# 							# 	NOR = {
# 							# 		has_holding_type = city_holding 
# 							# 		has_holding_type = church_holding
# 							# 	}
# 							# }
# 							NOT = { 
# 								THIS = scope:harem_liege.capital_barony 
# 							}
# 						}
# 					}
# 					ordered_held_title = {
# 						limit = {
# 							tier = tier_barony
# 							is_capital_barony = no
# 							is_leased_out = no
# 							# title_province ?= {
# 							# 	NOR = {
# 							# 		has_holding_type = city_holding 
# 							# 		has_holding_type = church_holding
# 							# 	}
# 							# }
# 							NOT = { 
# 								THIS = scope:harem_liege.capital_barony 
# 							}
# 						}
# 						order_by = {
# 							value = 0
# 							subtract = title_province.combined_building_level
# 						}
# 						save_scope_as = worst_title
# 					}
# 				}
# 				else_if = { # Find a valid county to give away
# 					limit = {
# 						any_held_title = {
# 							tier = tier_county
# 							NOT = { THIS = scope:harem_liege.capital_county }
# 							count >= 3
# 						}
# 					}
# 					ordered_held_title = {
# 						limit = {
# 							tier = tier_county
# 							NOT = { THIS = scope:harem_liege.capital_county }
# 						}
# 						order_by = {
# 							value = 0
# 							subtract = development_level
# 						}
# 						save_scope_as = worst_title
# 					}
# 				}
# 			}
# 			else_if = { #Promote one rank
# 				limit = {
# 					scope:consort_relative = {
# 						is_landed = yes
# 						is_vassal_of = scope:harem_liege
# 						highest_held_title_tier <= tier_county
# 					}
# 				}
# 				scope:consort_relative = {
# 					primary_title = {
# 						de_jure_liege = {
# 							save_scope_as = worst_title
# 						}
# 					}
# 				}
# 			}
# 		}
# 	}
	
# 	#Summon to bed
# 	option = {
# 		name = consort_play.1002.a
# 		trigger = {
# 			scope:harem_liege = {
# 				NOR = {
# 					has_trait = celibate
# 					has_trait = eunuch
# 				}
# 				is_healthy = yes
# 			}
# 			NOR = {	
# 				exists = local_var:requested_harem_promotion
# 				exists = scope:worst_title
# 				exists = local_var:praised_fellow_consort
# 			}
# 		}

# 		scope:consort = {
# 			if = {
# 				limit = {
# 					has_trait = chaste
# 				}
# 				stress_impact = {
# 					base = minor_stress_impact_gain
# 				}
# 			}
# 		}
# 		scope:harem_liege = {
# 			if = {
# 				limit = {
# 					NOR = {
# 						has_trait = chaste
# 						has_trait = lustful
# 					}
# 				}
# 				stress_impact = {
# 					base = minor_stress_impact_loss
# 				}
# 			}
# 			else_if = {
# 				limit = {
# 					has_trait = chaste
# 				}
# 				stress_impact = {
# 					base = minor_stress_impact_gain
# 				}
# 			}
# 			random_list = {
# 				25 = { #Progress towards lovers - root loved the consort
# 					simple_attraction_modifier = {
# 						WHO = scope:consort
# 						TARGET = scope:harem_liege
# 						MAX_PERSONALITY = 50 # -50 at low trait combatibility, +150 at high trait combatibility.
# 						MAX_PHYSICAL = 50 # Will be -25 by default (due to Rakish) but can vary from between -150 and +150 due to other Attraction modifiers.
# 					}
# 					opinion_modifier = {
# 						opinion_target = scope:consort
# 						min = -100
# 						max = 100
# 						multiplier = 1
# 					}
# 					opinion_modifier = {
# 						who = scope:consort
# 						opinion_target = scope:harem_liege
# 						min = -100
# 						max = 100
# 						multiplier = 1
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_trait = lustful
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						scope:harem_liege = {
# 							has_trait = lustful
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						has_relation_lover = scope:consort
# 						add = 5
# 					}
# 					modifier = {
# 						has_relation_soulmate = scope:consort
# 						add = 15
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_character_modifier = favor_boost_modifier
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						NOT = { scope:harem_liege = { is_attracted_to_gender_of = scope:consort } }
# 						factor = 0
# 					}
# 					modifier = {
# 						NOT = { scope:consort = { is_attracted_to_gender_of = scope:harem_liege } }
# 						factor = 0.7
# 					}
# 					if = {
# 						limit = {
# 							NOR = {
# 								has_relation_lover = scope:consort
# 								has_relation_soulmate = scope:consort
# 								has_relation_potential_lover = scope:consort
# 							}
# 						}
# 						set_relation_potential_lover = scope:consort
# 					}
# 					had_sex_with_effect = {
# 						CHARACTER = scope:consort
# 						PREGNANCY_CHANCE = pregnancy_chance
# 					}
# 					scope:consort = {
# 						add_opinion = {
# 							target = scope:harem_liege
# 							modifier = romance_opinion
# 							opinion = 10
# 						}	
# 						calyver_favor_medium_gain_effect = yes	
# 					}
# 					hidden_effect = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = romance_opinion
# 							opinion = 10
# 						}
# 						scope:consort = {
# 							send_interface_toast = {
# 								type = event_generic_good
# 								title = good_consort_visit_t
# 								right_icon = scope:harem_liege
# 								if = {
# 									limit = {
# 										has_trait = chaste
# 									}
# 									stress_impact = {
# 										base = minor_stress_impact_gain
# 									}
# 								}
# 								show_as_tooltip = {
# 									had_sex_with_effect = {
# 										CHARACTER = scope:harem_liege
# 										PREGNANCY_CHANCE = pregnancy_chance
# 									}
# 									if = {
# 										limit = {
# 											NOR = {
# 												has_relation_lover = scope:harem_liege
# 												has_relation_soulmate = scope:harem_liege
# 												has_relation_potential_lover = scope:harem_liege
# 											}
# 										}
# 										set_relation_potential_lover = scope:harem_liege
# 									}
# 									calyver_favor_medium_gain_effect = yes	
# 									scope:harem_liege = {
# 										add_opinion = {
# 											target = scope:consort
# 											modifier = romance_opinion
# 											opinion = 10
# 										}
# 									}	
# 								}
# 							}
# 						}
# 					}
# 				}
# 				50 = { #Root liked the consort
# 					simple_attraction_modifier = {
# 						WHO = scope:consort
# 						TARGET = scope:harem_liege
# 						MAX_PERSONALITY = 50 # -50 at low trait combatibility, +150 at high trait combatibility.
# 						MAX_PHYSICAL = 50 # Will be -25 by default (due to Rakish) but can vary from between -150 and +150 due to other Attraction modifiers.
# 					}
# 					opinion_modifier = {
# 						opinion_target = scope:consort
# 						min = -100
# 						max = 100
# 						multiplier = 1
# 					}
# 					opinion_modifier = {
# 						who = scope:consort
# 						opinion_target = scope:harem_liege
# 						min = -100
# 						max = 100
# 						multiplier = 1
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_trait = lustful
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						scope:harem_liege = {
# 							has_trait = lustful
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_character_modifier = favored_consort_modifier
# 						}
# 						add = 5
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_character_modifier = beloved_consort_modifier
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						NOT = { scope:harem_liege = { is_attracted_to_gender_of = scope:consort } }
# 						factor = 0
# 					}
# 					modifier = {
# 						NOT = { scope:consort = { is_attracted_to_gender_of = scope:harem_liege } }
# 						factor = 0.7
# 					}
# 					had_sex_with_effect = {
# 						CHARACTER = scope:consort
# 						PREGNANCY_CHANCE = pregnancy_chance
# 					}
# 					scope:consort = {
# 						add_opinion = {
# 							target = scope:harem_liege
# 							modifier = romance_opinion
# 							opinion = 5
# 						}	
# 						calyver_favor_minor_gain_effect = yes	
# 					}
# 					hidden_effect = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = romance_opinion
# 							opinion = 5
# 						}
# 						scope:consort = {
# 							send_interface_toast = {
# 								type = event_generic_good
# 								title = good_consort_visit_t
# 								right_icon = scope:harem_liege
# 								if = {
# 									limit = {
# 										has_trait = chaste
# 									}
# 									stress_impact = {
# 										base = minor_stress_impact_gain
# 									}
# 								}
# 								show_as_tooltip = {
# 									had_sex_with_effect = {
# 										CHARACTER = scope:harem_liege
# 										PREGNANCY_CHANCE = pregnancy_chance
# 									}
# 									calyver_favor_minor_gain_effect = yes	
# 									scope:harem_liege = {
# 										add_opinion = {
# 											target = scope:consort
# 											modifier = romance_opinion
# 											opinion = 5
# 										}
# 									}	
# 								}
# 							}
# 						}
# 					}
# 				}
# 				50 = { #Nothing	
# 					had_sex_with_effect = {
# 						CHARACTER = scope:consort
# 						PREGNANCY_CHANCE = pregnancy_chance
# 					}
# 					scope:consort = {
# 						add_opinion = {
# 							target = scope:harem_liege
# 							modifier = romance_opinion
# 							opinion = 5
# 						}
# 					}
# 					hidden_effect = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = romance_opinion
# 							opinion = 5
# 						}
# 						scope:consort = {
# 							send_interface_toast = {
# 								type = event_generic_good
# 								title = good_consort_visit_t
# 								right_icon = scope:harem_liege
# 								if = {
# 									limit = {
# 										has_trait = chaste
# 									}
# 									stress_impact = {
# 										base = minor_stress_impact_gain
# 									}
# 								}
# 								show_as_tooltip = {
# 									had_sex_with_effect = {
# 										CHARACTER = scope:harem_liege
# 										PREGNANCY_CHANCE = pregnancy_chance
# 									}
# 									scope:harem_liege = {
# 										add_opinion = {
# 											target = scope:consort
# 											modifier = romance_opinion
# 											opinion = 5
# 										}
# 									}	
# 								}
# 							}
# 						}
# 					}
# 				}
# 				25 = { #Uncomfortable night
# 					simple_attraction_modifier = {
# 						WHO = scope:consort
# 						TARGET = scope:harem_liege
# 						MAX_PERSONALITY = -50 # -50 at low trait combatibility, +150 at high trait combatibility.
# 						MAX_PHYSICAL = -50 # Will be -25 by default (due to Rakish) but can vary from between -150 and +150 due to other Attraction modifiers.
# 					}
# 					opinion_modifier = {
# 						opinion_target = scope:consort
# 						min = -100
# 						max = 100
# 						multiplier = -1
# 					}
# 					opinion_modifier = {
# 						who = scope:consort
# 						opinion_target = scope:harem_liege
# 						min = -100
# 						max = 100
# 						multiplier = -1
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_trait = chaste
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						scope:harem_liege = {
# 							has_trait = chaste
# 						}
# 						add = 10
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_character_modifier = favored_consort_modifier
# 						}
# 						add = -5
# 					}
# 					modifier = {
# 						scope:consort = {
# 							has_character_modifier = beloved_consort_modifier
# 						}
# 						add = -10
# 					}
# 					modifier = {
# 						NOT = { scope:harem_liege = { is_attracted_to_gender_of = scope:consort } }
# 						add = 50
# 					}
# 					modifier = {
# 						NOT = { scope:consort = { is_attracted_to_gender_of = scope:harem_liege } }
# 						add = 25
# 					}
# 					custom_tooltip = consort_visit_negative_outcome_tooltip
# 					if = {
# 						limit = {
# 							has_trait = lustful
# 						}
# 						stress_impact = {
# 							base = minor_stress_impact_gain
# 						}
# 					}
# 					scope:consort = {
# 						add_opinion = {
# 							target = scope:harem_liege
# 							modifier = disappointed_opinion
# 							opinion = -10
# 						}
# 						calyver_favor_minor_loss_effect = yes
# 					}
# 					hidden_effect = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = disappointed_opinion
# 							opinion = -10
# 						}
# 						scope:consort = {
# 							send_interface_toast = {
# 								type = event_generic_bad
# 								title = bad_consort_visit_t
# 								right_icon = scope:harem_liege
# 								if = {
# 									limit = {
# 										has_trait = lustful
# 									}
# 									stress_impact = {
# 										base = minor_stress_impact_gain
# 									}
# 								}
# 								show_as_tooltip = {
# 									calyver_favor_minor_loss_effect = yes
# 									scope:harem_liege = {
# 										add_opinion = {
# 											target = scope:consort
# 											modifier = disappointed_opinion
# 											opinion = -10
# 										}
# 									}
# 								}
# 							}
# 						}
# 					}
# 				}
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 			modifier = { #Traits
# 				add = 20
# 				scope:harem_liege = {
# 					has_trait = lustful
# 				}
# 			}
# 			modifier = { #Traits
# 				add = 5
# 				scope:consort = {
# 					has_trait = lustful
# 				}
# 			}
# 		}
# 	}

# 	#Promote consort
# 	option = {
# 		name = {
# 			text = {
# 				first_valid = {
# 					triggered_desc = {
# 						trigger = { 
# 							scope:harem_liege = { #Can appoint a GC
# 								can_appoint_char_to_court_position = {
# 									CHAR = scope:consort
# 									COURT_POS = grand_consort_court_position
# 								}
# 							}
# 						}
# 						desc = consort_play.1002.b.gc
# 					}
# 					desc = consort_play.1002.b.ss
# 				}
# 			}
# 		}
# 		trigger = {
# 			exists = local_var:requested_harem_promotion
# 			OR = {
# 				scope:harem_liege = { #Can appoint a GC
# 					can_appoint_char_to_court_position = {
# 						CHAR = scope:consort
# 						COURT_POS = grand_consort_court_position
# 					}
# 				}
# 				AND = { #Concubine to spouse
# 					scope:consort = {
# 						is_concubine = yes
# 					}
# 					scope:harem_liege = {
# 						allowed_more_spouses = yes
# 					}
# 				}
# 			}
# 		}
		
# 		scope:harem_liege = {
# 			if = { #Appoint to GC
# 				limit = {
# 					can_appoint_char_to_court_position = {
# 						CHAR = scope:consort
# 						COURT_POS = grand_consort_court_position
# 					}
# 				}
# 				appoint_court_position = {
# 					recipient = scope:consort
# 					court_position = grand_consort_court_position
# 				}
# 			}
# 			else_if = {
# 				limit = {
# 					scope:consort = {
# 						is_concubine = yes
# 					}
# 					allowed_more_spouses = yes
# 				}
# 				if = {
# 					limit = {
# 						has_trait = just
# 						OR = {
# 							has_imprisonment_reason = scope:consort
# 							scope:consort = {
# 								any_secret = {
# 									exists = secret_owner
# 									is_known_by = scope:harem_liege
# 									is_criminal_for = secret_owner
# 								}
# 							}
# 						}
# 					}
# 					stress_impact = {
# 						just = minor_stress_impact_gain
# 					}
# 				}
# 				if = {
# 					limit = {
# 						is_female = yes
# 					}
# 					marry_matrilineal = scope:consort
# 				}
# 				else = {
# 					marry = scope:consort
# 				}
# 				scope:consort = {
# 					save_scope_as = secondary_recipient
# 				}
# 				save_scope_as = actor
# 				save_scope_as = secondary_actor
# 				save_scope_as = recipient
# 				marriage_interaction_on_accept_effect = yes
# 			}
# 		}

# 		ai_chance = {
# 			base = 10
# 		}
# 	}

# 	#Grant Title
# 	option = {
# 		name = harem_politics.0008.a
# 		trigger = {
# 			scope:consort_relative ?= {
# 				valid_relative_promotion_trigger = yes
# 				is_lowborn = no
# 			}
# 			exists = scope:worst_title
# 		}
# 		show_as_unavailable = { 
# 			exists = local_var:requested_relative_promotion
# 			scope:consort_relative ?= {
# 				highest_held_title_tier = tier_county
# 			}
# 			scope:worst_title ?= {
# 				is_title_created = no
# 			}
# 			NOT = { 
# 				gold >= create_duchy_title_value_harem_politics 
# 			}
# 		}
# 		scope:consort = {
# 			calyver_favor_big_gain_effect = yes
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = grateful_opinion
# 				opinion = 20
# 			}
# 			add_character_flag = {
# 				flag = requested_favor_flag
# 				years = 3
# 			}
# 		}
# 		hidden_effect = {
# 			scope:harem_liege = {
# 				every_consort = {
# 					limit = {
# 						AND = {
# 							NOR = {
# 								this = scope:consort
# 								any_close_or_extended_family_member = {
# 									this = scope:consort
# 								}
# 								has_relation_best_friend = scope:consort
# 								has_relation_friend = scope:consort
# 								has_relation_lover = scope:consort
# 								has_relation_soulmate = scope:consort
# 							}
# 							harem_politics_evil_consort_trigger = yes
# 						}
# 					}
# 					add_opinion = {
# 						target = scope:consort
# 						modifier = envy_consort_opinion
# 					}
# 				}
# 			}
# 			scope:consort = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = good_consort_visit_t
# 					right_icon = scope:harem_liege
# 					left_icon = scope:consort_relative
# 					show_as_tooltip = {
# 						calyver_favor_big_gain_effect = yes
# 					}
# 					scope:consort_relative = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = grateful_opinion
# 							opinion = 20
# 						}
# 						show_as_tooltip = {
# 							scope:harem_liege = {
# 								create_title_and_vassal_change = {
# 									type = granted
# 									save_scope_as = change
# 									add_claim_on_loss = no
# 								}
# 								scope:worst_title = {
# 									change_title_holder = {
# 										holder = scope:consort_relative
# 										change = scope:change
# 									}
# 								}
# 								resolve_title_and_vassal_change = scope:change
# 							}
# 						}
# 					}
# 				}
# 			}
# 		}

# 		scope:harem_liege = {	
# 			send_interface_toast = {
# 				type = event_generic_neutral
# 				left_icon = scope:consort_relative
# 				title = harem_politics.0008.a.tt
# 				consort_gp_promote_relative_effect = yes
# 				if = { #Stress gains unless you are over your domain limit
# 					limit = {
# 						OR = {
# 							AND = {
# 								scope:worst_title.tier = tier_duchy
# 								any_held_title = {
# 									tier = tier_duchy
# 									is_head_of_faith = no
# 									is_noble_family_title = no
# 									count <= 2
# 								}
# 							}
# 							AND = {
# 								scope:worst_title.tier = tier_county
# 								domain_size <= domain_limit
# 							}
# 						}
# 					}
# 					stress_impact = {
# 						greedy = medium_stress_impact_gain # But, titles
# 						diligent = medium_stress_impact_gain # But, I like managing stuff
# 						arrogant = medium_stress_impact_gain # But, my titles
# 					}
# 				}
# 				stress_impact = {
# 					lazy = minor_stress_impact_loss
# 					generous = minor_stress_impact_loss
# 				}
# 			}
# 		}

# 		ai_chance = {
# 			base = 50
# 		}
# 	}

# 	#Promote relative to noble status
# 	option = {
# 		name = consort_play.1002.d
# 		#Also see the last option's effects when this option is available
# 		#And add a flag to stop consorts from requesting favors every year
# 		trigger = {
# 			scope:consort_relative ?= {
# 				valid_relative_promotion_trigger = yes
# 				is_lowborn = yes
# 			}
# 			exists = local_var:requested_relative_promotion
# 		}
# 		show_as_unavailable = { 
# 			exists = local_var:requested_relative_promotion
# 			NOT = { 
# 				gold >= 20 
# 			}
# 		}
# 		scope:consort = {
# 			calyver_favor_medium_gain_effect = yes
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = grateful_opinion
# 				opinion = 10
# 			}
# 			add_character_flag = {
# 				flag = requested_favor_flag
# 				years = 3
# 			}
# 		}
# 		hidden_effect = {
# 			scope:consort_relative = {
# 				add_short_term_gold = 10
# 				create_dynamic_title = {
# 					tier = duchy
# 					name = NEW_CREATED_TITLE_NAME
# 				}
# 				create_title_and_vassal_change = {
# 					type = created
# 					save_scope_as = change
# 					add_claim_on_loss = no
# 				}
# 				scope:new_title = {
# 					set_capital_county = scope:harem_liege.capital_county
# 					set_landless_title = yes
# 					set_destroy_on_gain_same_tier = yes
# 					set_no_automatic_claims = yes
# 					set_can_be_named_after_dynasty = no
# 					change_title_holder = {
# 						holder = prev
# 						change = scope:change
# 					}
# 				}
# 				resolve_title_and_vassal_change = scope:change
# 				scope:new_title = {
# 					generate_coa = yes
# 				}
# 				destroy_title = scope:new_title
# 				if = { #Promote their relatives too
# 					limit = {
# 						any_close_family_member = {
# 							is_lowborn = yes
# 						}
# 					}
# 					every_close_family_member = {
# 						limit = {
# 							is_lowborn = yes
# 						}
# 						add_to_list = target_relatives_list
# 					}
# 				}
# 				if = { #And consorts
# 					limit = {
# 						any_consort = {
# 							is_lowborn = yes
# 							is_parent_of = scope:consort
# 						}
# 					}
# 					every_consort = {
# 						limit = {
# 							is_lowborn = yes
# 							is_parent_of = scope:consort
# 						}
# 						add_to_list = target_relatives_list
# 					}
# 				}
# 				if = {
# 					limit = {
# 						any_in_list = {
# 							list = target_relatives_list
# 							count >= 1
# 						}
# 					}
# 					every_in_list = {
# 						list = target_relatives_list
# 						limit = {
# 							is_lowborn = yes
# 						}
# 						set_house = scope:consort_relative.house
# 					}
# 				}
# 				if = { #Add their relatives to court
# 					limit = {
# 						any_close_family_member = {
# 							NOT = {
# 								is_courtier_of = root
# 							}
# 							OR = {
# 								top_liege ?= scope:harem_liege
# 								NOR = {
# 									is_councillor = yes
# 									has_any_court_position = yes
# 									any_consort = {
# 										is_landed = yes
# 									}
# 								}
# 							}
# 						}
# 					}
# 					every_close_family_member = {
# 						limit = {
# 							NOT = {
# 								is_courtier_of = root
# 							}
# 							OR = {
# 								top_liege ?= scope:harem_liege
# 								NOR = {
# 									is_councillor = yes
# 									has_any_court_position = yes
# 									any_consort = {
# 										is_landed = yes
# 									}
# 								}
# 							}
# 						}
# 						add_to_list = relatives_to_add_list
# 					}
# 				}
# 				if = { #And consorts
# 					limit = {
# 						any_consort = {
# 							NOT = {
# 								is_courtier_of = root
# 							}
# 							OR = {
# 								top_liege ?= scope:harem_liege
# 								NOR = {
# 									is_councillor = yes
# 									has_any_court_position = yes
# 									any_consort = {
# 										is_landed = yes
# 									}
# 								}
# 							}
# 						}
# 					}
# 					every_consort = {
# 						limit = {
# 							NOT = {
# 								is_courtier_of = root
# 							}
# 							OR = {
# 								top_liege ?= scope:harem_liege
# 								NOR = {
# 									is_councillor = yes
# 									has_any_court_position = yes
# 									any_consort = {
# 										is_landed = yes
# 									}
# 								}
# 							}
# 						}
# 						add_to_list = relatives_to_add_list
# 					}
# 				}
# 				if = {
# 					limit = {
# 						any_in_list = {
# 							list = relatives_to_add_list
# 							count >= 1
# 						}
# 					}
# 					every_in_list = {
# 						list = relatives_to_add_list
# 						scope:harem_liege = {
# 							add_courtier = prev
# 						}
# 					}
# 				}
# 			}
# 			scope:harem_liege = {
# 				add_courtier = scope:consort_relative
# 				every_consort = {
# 					limit = {
# 						AND = {
# 							NOR = {
# 								this = scope:consort
# 								any_close_or_extended_family_member = {
# 									this = scope:consort
# 								}
# 								has_relation_best_friend = scope:consort
# 								has_relation_friend = scope:consort
# 								has_relation_lover = scope:consort
# 								has_relation_soulmate = scope:consort
# 							}
# 							harem_politics_evil_consort_trigger = yes
# 						}
# 					}
# 					add_opinion = {
# 						target = scope:consort
# 						modifier = envy_consort_opinion
# 					}
# 				}
# 			}
# 			scope:consort = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = good_consort_visit_t
# 					right_icon = scope:harem_liege
# 					left_icon = scope:consort_relative
# 					show_as_tooltip = {
# 						calyver_favor_medium_gain_effect = yes
# 					}
# 					scope:consort_relative = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = grateful_opinion
# 							opinion = 10
# 						}
# 						show_as_tooltip = {
# 							set_house = scope:consort_relative.house
# 							if = {
# 								limit = {
# 									exists = scope:consort.house
# 									house ?= scope:consort.house
# 								}
# 								scope:consort = {
# 									set_house = scope:consort_relative.house
# 								}
# 							}
# 						}
# 					}
# 				}
# 			}
# 		}

# 		scope:harem_liege = {
# 			show_as_tooltip = {
# 				stress_impact = {
# 					greedy = medium_stress_impact_gain # But, gold
# 					arrogant = medium_stress_impact_gain # But, commoners
# 					generous = minor_stress_impact_loss
# 				}
# 				remove_short_term_gold = 20
# 				custom_tooltip = will_establish_a_house_tooltip
# 			}	
# 			hidden_effect = {
# 				send_interface_toast = {
# 					type = event_generic_neutral
# 					left_icon = scope:consort_relative
# 					title = harem_politics.0008.a.tt #Check
# 					stress_impact = {
# 						greedy = medium_stress_impact_gain # But, gold
# 						arrogant = medium_stress_impact_gain # But, commoners
# 						generous = minor_stress_impact_loss
# 					}
# 					remove_short_term_gold = 20
# 					show_as_tooltip = {
# 						scope:consort_relative = {
# 							set_house = scope:consort_relative.house
# 						}
# 						scope:consort = {
# 							if = {
# 								limit = {
# 									exists = scope:consort_relative.house
# 									house ?= scope:consort_relative.house
# 								}
# 								scope:consort = {
# 									set_house = scope:consort_relative.house
# 								}
# 							}
# 						}
# 					}
# 				}
# 			}
# 			#Courtly vassals won't like it
# 			if = {
# 				limit = {
# 					any_vassal = { 
# 						has_vassal_stance = courtly
# 						count >= 1
# 					}
# 				}
# 				custom_tooltip = elevate_relative_courtly_vassal_penalty
# 				hidden_effect = {
# 					every_vassal = {
# 						limit = { 
# 							has_vassal_stance = courtly
# 						}
# 						add_opinion = {
# 							target = scope:harem_liege
# 							modifier = elevate_lowborn_vassal_opinion
# 						}
# 					}
# 				}
# 			}
# 		}

# 		ai_chance = {
# 			base = 50
# 		}
# 	}

# 	#I should see good_consort more often
# 	option = {
# 		name = consort_play.1002.e
# 		trigger = {
# 			exists = scope:good_consort
# 			exists = local_var:praised_fellow_consort
# 		}

# 		scope:good_consort = {
# 			calyver_favor_moderate_gain_effect = yes
# 			if = {
# 				limit = { can_set_relation_potential_friend_trigger = { CHARACTER = scope:consort } }
# 				set_relation_potential_friend = scope:consort
# 			}
# 			add_opinion = {
# 				target = scope:consort
# 				modifier = friendliness_opinion
# 				opinion = 10
# 			}
# 			hidden_effect = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = praised_consort_t
# 					right_icon = scope:harem_liege
# 					left_icon = scope:consort
# 					custom_tooltip = praised_consort_desc
# 					show_as_tooltip = {
# 						calyver_favor_moderate_gain_effect = yes
# 					}
# 				}
# 			}
# 		}
# 		scope:harem_liege = {
# 			stress_impact = {
# 				shy = minor_stress_impact_gain
# 				paranoid = minor_stress_impact_gain
# 			}
# 		}

# 		scope:consort = {
# 			hidden_effect = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = good_consort_visit_t
# 					right_icon = scope:harem_liege
# 					left_icon = scope:good_consort
# 					show_as_tooltip = {
# 						scope:good_consort = {
# 							calyver_favor_moderate_gain_effect = yes
# 							if = {
# 								limit = { can_set_relation_potential_friend_trigger = { CHARACTER = scope:consort } }
# 								set_relation_potential_friend = scope:consort
# 							}
# 							add_opinion = {
# 								target = scope:consort
# 								modifier = friendliness_opinion
# 								opinion = 10
# 							}
# 						}
# 					}
# 				}
# 			}
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = pleased_opinion
# 				opinion = 5
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#They're an exemplary consort
# 	option = {
# 		name = consort_play.1002.f
# 		trigger = {
# 			exists = scope:good_consort
# 			exists = local_var:praised_fellow_consort
# 		}

# 		scope:good_consort = {
# 			calyver_favor_minor_gain_effect = yes
# 			add_opinion = {
# 				target = scope:consort
# 				modifier = friendliness_opinion
# 				opinion = 5
# 			}
# 			hidden_effect = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = praised_consort_t
# 					right_icon = scope:harem_liege
# 					left_icon = scope:consort
# 					custom_tooltip = praised_consort_desc
# 					show_as_tooltip = {
# 						calyver_favor_minor_gain_effect = yes
# 					}
# 				}
# 			}
# 		}
# 		scope:harem_liege = {
# 			stress_impact = {
# 				shy = minor_stress_impact_gain
# 				paranoid = minor_stress_impact_gain
# 			}
# 		}

# 		scope:consort = {
# 			hidden_effect = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = good_consort_visit_t
# 					right_icon = scope:harem_liege
# 					left_icon = scope:good_consort
# 					show_as_tooltip = {
# 						scope:good_consort = {
# 							calyver_favor_minor_gain_effect = yes
# 							add_opinion = {
# 								target = scope:consort
# 								modifier = friendliness_opinion
# 								opinion = 5
# 							}
# 						}
# 					}
# 				}
# 			}
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = pleased_opinion
# 				opinion = 5
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#You are a generous consort
# 	option = {
# 		name = consort_play.1002.g
# 		trigger = {
# 			exists = scope:good_consort
# 			exists = local_var:praised_fellow_consort
# 		}

# 		scope:harem_liege = {
# 			stress_impact = {
# 				shy = minor_stress_impact_gain
# 				paranoid = minor_stress_impact_gain
# 			}
# 		}

# 		scope:consort = {
# 			show_as_tooltip = {
# 				calyver_favor_moderate_gain_effect = yes
# 			}
# 			add_opinion = {
# 				target = scope:harem_liege
# 				modifier = pleased_opinion
# 				opinion = 10
# 			}
# 			hidden_effect = {
# 				send_interface_toast = {
# 					type = event_generic_good
# 					title = good_consort_visit_t
# 					right_icon = scope:harem_liege
# 					calyver_favor_moderate_gain_effect = yes
# 					scope:harem_liege = {
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = pleased_opinion
# 							opinion = 5
# 						}
# 					}
# 				}
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 		}
# 	}

# 	#It was a nice time
# 	option = {
# 		name = {
# 			text = {
# 				first_valid = {
# 					triggered_desc = {
# 						trigger = { 
# 							exists = local_var:praised_fellow_consort
# 						}
# 						desc = consort_play.1002.z.praised_fellow_consort
# 					}
# 					triggered_desc = {
# 						trigger = { 
# 							OR = {
# 								exists = local_var:requested_harem_promotion
# 								exists = scope:worst_title
# 							}
# 						}
# 						desc = consort_play.1002.z.requested_promotion
# 					}
# 					desc = consort_play.1002.z.generic
# 				}
# 			}
# 		}

# 		scope:harem_liege = {
# 			if = {
# 				limit = {
# 					NOR = {
# 						exists = local_var:praised_fellow_consort
# 						exists = local_var:requested_harem_promotion
# 						exists = scope:worst_title
# 					}
# 				}
# 				stress_impact = {
# 					lustful = minor_stress_impact_gain
# 				}
# 				add_opinion = {
# 					target = scope:consort
# 					modifier = friendliness_opinion
# 					opinion = 5
# 				}
# 			}
# 			else = {
# 				hidden_effect = {
# 					if = {
# 						limit = {
# 							OR = {	
# 								exists = local_var:requested_harem_promotion
# 								exists = scope:worst_title
# 							}
# 						}
# 						add_opinion = {
# 							target = scope:consort
# 							modifier = disappointed_opinion
# 							opinion = -10
# 						}
# 					}
# 				}
# 			}
# 		}

# 		scope:consort = {
# 			hidden_effect = {
# 				if = {
# 					limit = {
# 						OR = {	
# 							exists = local_var:praised_fellow_consort
# 							exists = local_var:requested_harem_promotion
# 							exists = scope:worst_title
# 						}
# 					}
# 					send_interface_toast = {
# 						type = event_generic_bad
# 						title = bad_consort_visit_t
# 						right_icon = scope:harem_liege
# 						show_as_tooltip = {
# 							if = {
# 								limit = {
# 									OR = {	
# 										exists = local_var:requested_harem_promotion
# 										exists = scope:worst_title
# 									}
# 								}
# 								calyver_favor_micro_loss_effect = yes
# 								scope:harem_liege = {
# 									add_opinion = {
# 										target = scope:consort
# 										modifier = disappointed_opinion
# 										opinion = -10
# 									}
# 								}
# 							}
# 							else = {
# 								custom_tooltip = consort_play.1002.z.tt
# 							}
# 						}
# 					}
# 				}
# 				else = {
# 					send_interface_toast = {
# 						type = event_generic_neutral
# 						title = neutral_consort_visit_t
# 						right_icon = scope:harem_liege
# 						show_as_tooltip = {
# 							scope:harem_liege = {
# 								add_opinion = {
# 									target = scope:consort
# 									modifier = friendliness_opinion
# 									opinion = 5
# 								}
# 							}
# 						}
# 					}
# 				}
# 			}
# 			if = {
# 				limit = {
# 					NOR = {	
# 						exists = local_var:praised_fellow_consort
# 						exists = local_var:requested_harem_promotion
# 						exists = scope:worst_title
# 					}
# 				}
# 				add_opinion = {
# 					target = scope:harem_liege
# 					modifier = friendliness_opinion
# 					opinion = 5
# 				}
# 			}
# 			else = {
# 				add_opinion = {
# 					target = scope:harem_liege
# 					modifier = disappointed_opinion
# 					opinion = -5
# 				}
# 				if = {
# 					limit = {
# 						OR = {	
# 							exists = local_var:requested_harem_promotion
# 							exists = scope:worst_title
# 						}
# 					}
# 					calyver_favor_micro_loss_effect = yes
# 				}
# 			}
# 		}
		
# 		ai_chance = {
# 			base = 1
# 			modifier = { #Traits
# 				add = 20
# 				scope:harem_liege = {
# 					has_trait = chaste
# 				}
# 				NOR = {	
# 					exists = local_var:requested_harem_promotion
# 					exists = scope:worst_title
# 					exists = local_var:praised_fellow_consort
# 				}
# 			}
# 			modifier = { #Traits
# 				add = 10
# 				scope:consort = {
# 					has_trait = chaste
# 				}
# 				NOR = {	
# 					exists = local_var:requested_harem_promotion
# 					exists = scope:worst_title
# 					exists = local_var:praised_fellow_consort
# 				}
# 			}
# 		}
# 	}
# }


# ##A servant notifies you a consort is coming##
# #########################
# ##Visiting an authority##
# #########################
# # consort_play.2000 = {
# # 	type = character_event
# # 	title = consort_play.2000.t
# # 	desc = consort_play.2000.desc
# # 	theme = family
# # 	override_background = {
# # 		reference = bedchamber
# # 	}
	
# # 	left_portrait = {
# # 		character = scope:homage_subordinate
# # 		animation = personality_rational
# # 	}
# # 	right_portrait = {
# # 		character = scope:homage_authority_1
# # 		animation = personality_greedy
# # 	}
	
# # 	trigger = {
# # 		NOR = {
# # 			exists = scope:is_being_divorced
# # 			exists = scope:is_being_set_aside
# # 		}
# # 		is_physically_able_adult = yes
# # 		exists = scope:harem_liege
# # 		scope:harem_liege = {
# # 			highest_held_title_tier >= tier_county
# # 			any_consort = {
# # 				is_available_allow_travelling = yes
# # 				is_courtier_of = scope:harem_liege
# # 				count >= 3
# # 			}
# # 		}
# # 		OR = {
# # 			AND = { # Concubines can pay respects to any spouse
# # 				is_concubine_of = scope:harem_liege
# # 				scope:harem_liege = {
# # 					any_consort = {
# # 						is_available_allow_travelling = yes
# # 						is_courtier_of = scope:harem_liege
# # 						OR = {
# # 							is_spouse_of = scope:harem_liege
# # 							#has_court_position = grand_consort_court_position
# # 						}
# # 						NOT = {
# # 							this = scope:harem_liege
# # 						}
# # 					}
# # 				}
# # 			}
# # 			AND = { # Secondary spouses can pay respects to the PS or the GC
# # 				is_spouse_of = scope:harem_liege
# # 				court_owner = {
# # 					any_consort = {
# # 						is_available_allow_travelling = yes
# # 						is_courtier_of = scope:harem_liege
# # 						OR = {
# # 							AND = {
# # 								exists = scope:harem_liege.primary_spouse
# # 								is_spouse_of = scope:harem_liege.primary_spouse
# # 							}
# # 							#has_court_position = grand_consort_court_position
# # 						}
# # 						NOT = {
# # 							this = scope:harem_liege
# # 						}
# # 					}
# # 				}
# # 			}
# # 		}
# # 	}

# # 	immediate = {
# # 		if = {
# # 			limit = {
# # 				is_concubine = yes
# # 				scope:harem_liege = {
# # 					any_consort = {
# # 						is_available_allow_travelling = yes
# # 						is_courtier_of = prev
# # 						OR = {
# # 							is_spouse_of = prev
# # 							#has_court_position = grand_consort_court_position
# # 						}
# # 					}
# # 				}
# # 			}
# # 			scope:harem_liege = {
# # 				every_consort = {
# # 					limit = {
# # 						is_available_allow_travelling = yes
# # 						is_courtier_of = prev
# # 						OR = {
# # 							is_spouse_of = prev
# # 							#has_court_position = grand_consort_court_position
# # 						}
# # 					}
# # 					add_to_list = authority_list
# # 				}
# # 			}
# # 			random_in_list = {
# # 				list = authority_list
# # 				weight = {
# # 					base = 1
# # 					modifier = {
# # 						add = 14
# # 						exists = scope:harem_liege.primary_spouse
# # 						this = scope:harem_liege.primary_spouse
# # 					}
# # 					modifier = {
# # 						add = 9
# # 						is_parent_of = scope:harem_liege
# # 					}
# # 					#modifier = {
# # 					#	add = 4
# # 					#	has_court_position = grand_consort_court_position
# # 					#}
# # 				}
# # 				save_scope_as = authority_1
# # 			}
# # 		}
# # 	}
	
# # 	option = {
# # 		name = consort_play.0004.a
# # 		custom_tooltip = consort_play.0004.a.tt
		
# # 		scope:authority_1 = {
# # 			save_scope_as = homage_authority
# # 			trigger_event = {
# # 				id = consort_play.0005
# # 				days = { 2 5 }
# # 			}	
# # 		}
# # 		ai_chance = {
# # 			base = 10
# # 		}
# # 	}

# # 	option = {
# # 		name = consort_play.0004.d
		
# # 		ai_chance = {
# # 			base = 0
# # 		}
# # 	}
# # }

# ##############################
# ##Someone is trying to visit##
# ##############################
# # consort_play.3000 = {
# # 	type = character_event
# # 	title = consort_play.0004.t
# # 	desc = consort_play.0005.desc
# # 	theme = family
# # 	override_background = {
# # 		reference = bedchamber
# # 	}
	
# # 	left_portrait = {
# # 		character = root
# # 		animation = personality_rational
# # 	}
# # 	lower_center_portrait = {
# # 		character = scope:homage_subordinate
# # 	}
	
# # 	trigger = {
# # 		exists = scope:homage_authority
# # 		exists = scope:harem_liege
# # 		exists = scope:homage_subordinate
# # 		NOR = {
# # 			exists = scope:is_being_divorced
# # 			exists = scope:is_being_set_aside
# # 		}
# # 		is_physically_able_adult = yes
# # 		#calyver_rank_is_superior_trigger = { HAREM_LIEGE = scope:harem_liege AUTHORITY = root TARGET_CONSORT = scope:homage_subordinate }
# # 	}

# # 	immediate = {
# # 	}
	
# # 	option = {
# # 		name = consort_play.0005.a
# # 		custom_tooltip = consort_play.0005.a.tt
		
# # 		scope:homage_subordinate = {
# # 			trigger_event = {
# # 				id = consort_play.0006
# # 				days = { 2 5 }
# # 			}	
# # 		}
# # 		ai_chance = {
# # 			base = 10
# # 		}
# # 	}

# # 	option = {
# # 		name = consort_play.0005.c
		
# # 		scope:homage_subordinate = {
# # 			show_as_tooltip = {
# # 				add_opinion = {
# # 					target = root
# # 					modifier = rejected_gift_opinion #Check
# # 					opinion = -5
# # 				}
# # 			}
# # 		}

# # 		ai_chance = {
# # 			base = 10
# # 		}
# # 	}
# # }

# ###################
# ##Choose a bowing##
# ###################
# # consort_play.4000 = {
# # 	type = character_event
# # 	title = consort_play.0004.t
# # 	desc = consort_play.0006.desc
# # 	theme = family
# # 	override_background = {
# # 		reference = throne_room
# # 	}
	
# # 	left_portrait = {
# # 		character = root
# # 		animation = personality_bold
# # 	}
# # 	lower_center_portrait = {
# # 		character = scope:homage_authority
# # 	}
	
# # 	trigger = {
# # 		exists = scope:homage_authority
# # 		exists = scope:harem_liege
# # 		exists = scope:homage_subordinate
# # 		NOR = {
# # 			exists = scope:is_being_divorced
# # 			exists = scope:is_being_set_aside
# # 		}
# # 		is_physically_able_adult = yes
# # 		scope:homage_authority = {
# # 			#calyver_rank_is_superior_trigger = { HAREM_LIEGE = scope:harem_liege AUTHORITY = scope:homage_authority TARGET_CONSORT = root }
# # 		}
# # 	}

# # 	immediate = {
# # 	}
	
# # 	#Respectful bow
# # 	option = {
# # 		name = consort_play.0006.a
# # 		custom_tooltip = consort_play.0006.a.tt

# # 		add_prestige = minor_prestige_loss

# # 		show_as_tooltip = {
# # 			scope:homage_authority = {
# # 				add_opinion = {
# # 					target = root
# # 					modifier = pleased_opinion
# # 					opinion = 5
# # 				}
# # 			}
# # 			if = {
# # 				limit = {
# # 					exists = scope:harem_liege.primary_spouse
# # 					this = scope:harem_liege.primary_spouse
# # 				}
# # 				scope:homage_authority = {
# # 					add_prestige = 30
# # 				}
# # 			}
# # 			#else_if = {
# # 			#	limit = {
# # 			#		has_court_position = grand_consort_court_position
# # 			#	}
# # 			#	scope:homage_authority = {
# # 			#		add_prestige = 20
# # 			#	}
# # 			#}
# # 			else_if = {
# # 				limit = {
# # 					is_spouse_of = scope:harem_liege
# # 				}
# # 				scope:homage_authority = {
# # 					add_prestige = 10
# # 				}
# # 			}
# # 			else = {
# # 				scope:homage_authority = {
# # 					add_prestige = 5
# # 				}
# # 			}
# # 		}
		
# # 		stress_impact = {
# # 			arrogant = minor_stress_impact_gain
# # 		}

# # 		set_local_variable = respectful_bow

# # 		ai_chance = {
# # 			base = 10
# # 			ai_value_modifier = {
# # 				ai_boldness = -0.1
# # 				ai_compassion = 0.1
# # 				ai_honor = 0.25
# # 			}
# # 			opinion_modifier = {
# # 				opinion_target = scope:homage_authority
# # 				multiplier = 0.2
# # 			}
# # 			modifier = {
# # 				has_trait = content
# # 				add = 10
# # 			}
# # 			modifier = {
# # 				has_trait = humble
# # 				add = 15
# # 			}
# # 			modifier = {
# # 				has_trait = craven
# # 				add = 10
# # 			}
# # 			modifier = { #Stress
# # 				has_trait = arrogant
# # 				add = -25
# # 			}

# # 			modifier = { #Prestige
# # 				prestige <= minor_prestige_loss
# # 				add = -25
# # 			}
# # 		}
# # 	}

# # 	#Neutral bow
# # 	option = {
# # 		name = consort_play.0006.b
# # 		custom_tooltip = consort_play.0006.b.tt

# # 		ai_chance = {
# # 			base = 10
# # 			ai_value_modifier = {
# # 				ai_boldness = -0.15
# # 				ai_compassion = 0.20
# # 				ai_honor = 0.15
# # 				ai_sociability = 0.20
# # 				ai_energy = -0.20
# # 			}

# # 			opinion_modifier = {
# # 				opinion_target = scope:homage_authority
# # 				multiplier = 0.1
# # 			}

# # 			modifier = {
# # 				has_trait = lazy
# # 				add = 20
# # 			}
# # 		}
# # 	}

# # 	#Disrespectful bow
# # 	option = {
# # 		name = consort_play.0006.c
# # 		custom_tooltip = consort_play.0006.c.tt

# # 		add_prestige = minor_prestige_gain

# # 		set_local_variable = disrespectful_bow

# # 		stress_impact = {
# # 			humble = minor_stress_impact_gain
# # 			craven = minor_stress_impact_gain
# # 		}

# # 		ai_chance = {
# # 			base = 10
# # 			ai_value_modifier = {
# # 				ai_boldness = 0.1
# # 				ai_compassion = -0.15
# # 				ai_honor = -0.25
# # 				ai_sociability = -0.25
# # 			}

# # 			opinion_modifier = {
# # 				opinion_target = scope:homage_authority
# # 				multiplier = -0.20
# # 			}

# # 			modifier = {
# # 				has_trait = arrogant
# # 				add = 20
# # 			}
# # 			modifier = {
# # 				has_trait = brave
# # 				add = 10
# # 			}
# # 			modifier = {
# # 				has_trait = ambitious
# # 				add = 10
# # 			}
# # 			modifier = {
# # 				has_trait = gregarious
# # 				add = -10
# # 			}

# # 			modifier = { #Stress
# # 				has_trait = craven
# # 				add = -25
# # 			}
# # 			modifier = { #Stress
# # 				has_trait = humble
# # 				add = -25
# # 			}

# # 			modifier = {
# # 				has_opinion_modifier = {
# # 					modifier = forced_me_concubine_marriage_opinion
# # 					target = scope:harem_liege
# # 				}
# # 				add = 20
# # 			}

# # 			modifier = {
# # 				scope:homage_authority = {
# # 					is_parent_of = scope:harem_liege
# # 				}
# # 				add = -50
# # 			}
# # 		}
# # 	}

# # 	after = {
# # 		scope:homage_authority = {
# # 			trigger_event = {
# # 				id = consort_play.0007
# # 				days = { 1 3 }
# # 			}	
# # 		}
# # 	}
# # }

# #######################
# ##Invite them to stay##
# #######################
# # consort_play.5000 = {
# # 	type = character_event
# # 	title = consort_play.0004.t
# # 	desc = consort_play.0007.desc
# # 	theme = family
# # 	override_background = {
# # 		reference = throne_room
# # 	}
	
# # 	left_portrait = {
# # 		character = root
# # 		animation = personality_bold
# # 	}
# # 	right_portrait = {
# # 		character = scope:homage_subordinate
# # 		animation = throne_room_bow_1
# # 	}
	
# # 	trigger = {
# # 		exists = scope:homage_authority
# # 		exists = scope:harem_liege
# # 		exists = scope:homage_subordinate
# # 		NOR = {
# # 			exists = scope:is_being_divorced
# # 			exists = scope:is_being_set_aside
# # 		}
# # 		is_physically_able_adult = yes
# # 		scope:homage_authority = {
# # 			#calyver_rank_is_superior_trigger = { HAREM_LIEGE = scope:harem_liege AUTHORITY = scope:homage_authority TARGET_CONSORT = scope:homage_subordinate }
# # 		}
# # 	}

# # 	immediate = {
# # 		if = {
# # 			limit = {
# # 				exists = local_var:respectful_bow
# # 			}
# # 			if = {
# # 				limit = {
# # 					scope:harem_liege.primary_spouse ?= {
# # 						this = scope:homage_subordinate
# # 					}
# # 				}
# # 				add_prestige = 30
# # 			}
# # 			#else_if = {
# # 			#	limit = {
# # 			#		scope:homage_subordinate = {
# # 			#			has_court_position = grand_consort_court_position
# # 			#		}
# # 			#	}
# # 			#	add_prestige = 20
# # 			#}
# # 			else_if = {
# # 				limit = {
# # 					scope:homage_subordinate = {
# # 						has_court_position = grand_consort_court_position
# # 					}
# # 				}
# # 				add_prestige = 10
# # 			}
# # 			else = {
# # 				add_prestige = 5
# # 			}
# # 			add_opinion = {
# # 				target = scope:homage_subordinate
# # 				modifier = pleased_opinion
# # 				opinion = 5
# # 			}
# # 		}
# # 		else_if = { #You get offended
# # 			limit = {
# # 				exists = local_var:disrespectful_bow
# # 			}
# # 			add_opinion = {
# # 				target = scope:homage_subordinate
# # 				modifier = insult_opinion
# # 				opinion = -10
# # 			}
# # 		}
# # 	}
	
# # 	#Dismiss them - Aggressively if they were disrespectful
# # 	option = {
# # 		name = {
# # 			trigger = { exists = local_var:disrespectful_bow }
# # 			text = consort_play.0007.a.disrespectful_bow
# # 		}
# # 		name = {
# # 			trigger = { NOT = { exists = local_var:disrespectful_bow } }
# # 			text = consort_play.0007.a.generic
# # 		}
# # 		custom_tooltip = consort_play.0007.a.tt

# # 		if = {
# # 			limit = {
# # 				exists = local_var:disrespectful_bow
# # 			}
# # 			if = {
# # 				limit = {
# # 					NOR = { has_relation_grudge = scope:homage_subordinate }
# # 					can_set_relation_potential_rival_trigger = { CHARACTER = scope:homage_subordinate }
# # 				}
# # 				set_relation_grudge = {
# # 					reason = consort_rival_reason
# # 					target = scope:homage_subordinate
# # 				}
# # 			}
# # 		}

# # 		scope:homage_subordinate = {
# # 			#Add modifier for insulting the authority unscathed
# # 			show_as_tooltip = {
# # 				if = {
# # 					limit = {
# # 						exists = local_var:disrespectful_bow
# # 					}
# # 					add_character_modifier = {
# # 						modifier = unpunished_rebellion_modifier
# # 						years = 1
# # 					}
# # 				}
# # 			}
# # 			trigger_event = {
# # 				id = consort_play.0008
# # 				days = { 1 2 }
# # 			}	
# # 		}

# # 		stress_impact = {
# # 			compassionate = minor_stress_impact_gain
# # 		}

# # 		ai_chance = {
# # 			base = 10
# # 			ai_value_modifier = {
# # 				ai_boldness = 0.2
# # 				ai_compassion = -0.2
# # 				ai_energy = 0.1
# # 			}
# # 			opinion_modifier = {
# # 				opinion_target = scope:homage_subordinate
# # 				multiplier = -0.2
# # 			}

# # 			modifier = {
# # 				has_trait = forgiving
# # 				add = -25
# # 			}
# # 			modifier = {
# # 				has_trait = compassionate
# # 				add = -15
# # 			}
# # 			modifier = {
# # 				has_trait = content
# # 				add = -10
# # 			}
# # 			modifier = {
# # 				has_trait = humble
# # 				add = -10
# # 			}

# # 			modifier = { #Stress
# # 				has_trait = arrogant
# # 				add = 50
# # 			}
# # 		}
# # 	}

# # 	#Punish them severely
# # 	option = {
# # 		name = consort_play.0007.b
# # 		custom_tooltip = consort_play.0007.b.tt
# # 		trigger = {
# # 			trigger = { exists = local_var:disrespectful_bow }
# # 		}

# # 		#Punishment effect

# # 		stress_impact = {
# # 			compassionate = minor_stress_impact_gain
# # 			forgiving = minor_stress_impact_gain
# # 		}

# # 		ai_chance = {
# # 			base = 10
# # 			ai_value_modifier = {
# # 				ai_boldness = 0.2
# # 				ai_compassion = -0.4
# # 				ai_energy = 0.1
# # 				ai_vengefulness = 0.5
# # 			}
# # 			opinion_modifier = {
# # 				opinion_target = scope:homage_subordinate
# # 				multiplier = -0.4
# # 			}

# # 			modifier = {
# # 				has_trait = forgiving
# # 				add = -25
# # 			}
# # 			modifier = {
# # 				has_trait = compassionate
# # 				add = -25
# # 			}
# # 			modifier = {
# # 				has_trait = content
# # 				add = -10
# # 			}
# # 			modifier = {
# # 				has_trait = humble
# # 				add = -10
# # 			}
			
# # 			modifier = { 
# # 				has_trait = arrogant
# # 				add = 20
# # 			}
# # 			modifier = { 
# # 				has_trait = callous
# # 				add = 20
# # 			}
# # 			modifier = { 
# # 				has_trait = wrathful
# # 				add = 20
# # 			}
# # 			modifier = { 
# # 				has_trait = sadistic
# # 				add = 20
# # 			}
# # 			modifier = { 
# # 				has_trait = vengeful
# # 				add = 25
# # 			}
# # 		}
# # 	}

# # 	#Scold them
# # 	option = {
# # 		name = consort_play.0007.b
# # 		custom_tooltip = consort_play.0007.b.tt
# # 		trigger = {
# # 			trigger = { exists = local_var:disrespectful_bow }
# # 		}

# # 		#Scolding effect
# # 		set_local_variable = scolded_subordinate



# # 		stress_impact = {
# # 			compassionate = minor_stress_impact_gain
# # 			forgiving = minor_stress_impact_gain

# # 			arrogant = minor_stress_impact_gain
# # 			callous = minor_stress_impact_gain
# # 			wrathful = minor_stress_impact_gain
# # 			sadistic = minor_stress_impact_gain
# # 			vengeful = minor_stress_impact_gain
# # 		}

# # 		ai_chance = {
# # 			base = 10
# # 			ai_value_modifier = {
# # 				ai_boldness = -0.2
# # 				ai_compassion = 0.1
# # 				ai_energy = -0.2
# # 				ai_vengefulness = -0.1
# # 			}
# # 			opinion_modifier = {
# # 				opinion_target = scope:homage_subordinate
# # 				multiplier = -0.4
# # 			}

# # 			modifier = {
# # 				has_trait = forgiving
# # 				add = -25
# # 			}
# # 			modifier = {
# # 				has_trait = compassionate
# # 				add = -25
# # 			}
# # 			modifier = {
# # 				has_trait = content
# # 				add = 10
# # 			}
# # 			modifier = {
# # 				has_trait = humble
# # 				add = 10
# # 			}
			
# # 			modifier = { 
# # 				has_trait = arrogant
# # 				add = -20
# # 			}
# # 			modifier = { 
# # 				has_trait = callous
# # 				add = -20
# # 			}
# # 			modifier = { 
# # 				has_trait = wrathful
# # 				add = -20
# # 			}
# # 			modifier = { 
# # 				has_trait = sadistic
# # 				add = -20
# # 			}
# # 			modifier = { 
# # 				has_trait = vengeful
# # 				add = -25
# # 			}
# # 		}
# # 	}

# # 	after = {
# # 		scope:homage_authority = {
# # 			trigger_event = {
# # 				id = consort_play.0008
# # 				days = { 2 5 }
# # 			}	
# # 		}
# # 	}
# # }

# ################################
# ##Someone pays respects to you##
# ################################
# # consort_play.4050 = {
# # 	type = character_event
# # 	title = consort_play.0001.t
# # 	desc = consort_play.0001.desc
# # 	theme = family
# # 	override_background = {
# # 		reference = throne_room
# # 	}
	
# # 	left_portrait = scope:homage_authority
# # 	right_portrait = {
# # 		character = scope:homage_subordinate
# # 		animation = throne_room_bow_1
# # 	}
	
# # 	trigger = {
# # 		NOR = {
# # 			exists = scope:is_being_divorced
# # 			exists = scope:is_being_set_aside
# # 		}
# # 		is_physically_able_adult = yes
# # 	}

# # 	immediate = {
# # 		add_prestige = minor_prestige_gain
# # 	}
	
# # 	option = {
# # 		name = consort_play.0001.a
		
		
# # 		ai_chance = {
# # 			base = 10
# # 		}
# # 	}

# # 	after = {
# # 		scope:homage_subordinate = {
# # 			trigger_event = {
# # 				id = consort_play.0011
# # 				days = 1
# # 			}
# # 		}
# # 	}
# # }

# ##############################
# ##I paid respects to someone##
# ##############################
# # consort_play.0011 = {
# # 	type = character_event
# # 	title = consort_play.0001.t
# # 	desc = consort_play.0002.desc
# # 	theme = family
# # 	override_background = {
# # 		reference = throne_room
# # 	}
	
# # 	left_portrait = scope:homage_authority
# # 	right_portrait = {
# # 		character = scope:homage_subordinate
# # 		animation = throne_room_bow_1
# # 	}
	
# # 	trigger = {
# # 		NOR = {
# # 			exists = scope:is_being_divorced
# # 			exists = scope:is_being_set_aside
# # 		}
# # 		is_physically_able_adult = yes
# # 	}

# # 	immediate = {
# # 	}
	
# # 	option = {
# # 		name = consort_play.0002.a
		
		
# # 		ai_chance = {
# # 			base = 10
# # 		}
# # 	}
# # }

# ##Run interactions through events
# #
# #run_interaction = {
# #	interaction = liege_dismiss_entrenched_regency_interaction
# #	actor = root
# #	recipient = diarch
# #	execute_threshold = decline
# #}